Skip to contentSkip to conversation

Windows,grub and grub2

DISCUSSION Viswesh S 2 participants 2 messages Sep 9, 2008 – Sep 22, 2008

lore
Share & tools
lore

Viswesh S

author
#0 lore raw

----- Original Message ----
From: Bean <[email protected]>
To: The development of GRUB 2 <[email protected]>
Sent: Thursday, 4 September, 2008 11:07:46 PM
Subject: Re: Windows,grub and grub2

Quoted 32 lines · Viswesh S

----- Original Message ----
From: Bean <[email protected]>
To: The development of GRUB 2 <[email protected]>
Sent: Monday, 1 September, 2008 9:05:48 PM
Subject: Re: Windows,grub and grub2

Quoted 2 lines · Viswesh S

Hi,

Perhaps you can upload the boot sector file ? I can dissemble it to see where the error is printed.

--
Bean
Hi,

I was just trying out a way to disassemble it, as objdump didnt give it to me.I think I am not giving the right option,I suppose for binary.Let me know how to disassemble the binary.

I have attached the boot record.

Hi,

Quoted 11 lines

I'm sorry for the delay, I'm a little busy in the last few days.

I have disassemble the boot sector, there are three places where the error could occur, please chain load the file in the attachment and write down the screen output:

chainloader /ntfsnew
boot

Signature · 1 line
Bean

Hi,

Below is the dump of screen output while chainloading the ntfsnew file.
***************************************
DI=CFF0 SI=07EE BP=1FF0 SP=1FE8 BX=0000 DX=0000 CX=0000 AX=0000 CS=0000 SS=0000 DS=0000 ES=0000 FG=0246 IP=7C57

DI=7FF0 SI=07EE BP=1FF0 SP=7BF4 BX=55AA DX=0000 CX=0000 AX=0100 CX=07C0
DS=07C0 ES=0000 FG=0007 IP=0082
******************************************
Could you please let me know the way to disassemble the binary file without any header.The way in which you decoded the boot record.

Also one more thing to let you know is that,

with the grub-1.96 ( without the chainloader patch of disk->dev->read() ) , with windows2003 in partition 1 and linux in partition 3, when we chainload, if we look at the partition table passed to another bootloader ie location 0x7be - we can see that it is junk, but the surprising point is that, in this case as I have mentioned in my first mail, windows boots up from grub2.So it is that the partition table is not required for the chainloader thing and just the boot record is sufficient

Viswesh

Add more friends to your messenger and enjoy! Go to http://in.messenger.yahoo.com/invite/

#1 lore raw
Quoted 13 lines · Viswesh S

Below is the dump of screen output while chainloading the ntfsnew file.
***************************************
DI=CFF0 SI=07EE BP=1FF0 SP=1FE8 BX=0000 DX=0000 CX=0000 AX=0000 CS=0000 SS=0000 DS=0000 ES=0000 FG=0246 IP=7C57

DI=7FF0 SI=07EE BP=1FF0 SP=7BF4 BX=55AA DX=0000 CX=0000 AX=0100 CX=07C0 DS=07C0 ES=0000 FG=0007 IP=0082
******************************************
Could you please let me know the way to disassemble the binary file without any header.The way in which you decoded the boot record.

Also one more thing to let you know is that,

Quoted 7 lines

with the grub-1.96 ( without the chainloader patch of disk->dev->read() ) , with windows2003 in partition 1 and linux in partition 3, when we chainload, if we look at the partition table passed to another bootloader ie location 0x7be - we can see that it is junk, but the surprising point is that, in this case as I have mentioned in my first mail, windows boots up from grub2.So it is that the partition table is not required for the chainloader thing and just the boot record is sufficient

Hi,

Oh, sorry for another long delay. I disassemble the file with ida, which is an amazing tool. I don't know if there is open source alternative, please let me know if you find one.

The output from ida is in masm format, I modify it a bit so that it can be compiled using nasm. Please note that nasm doesn't generate the same binary file as original one, but you can get an idea what it does.

From the output, the program fails at the second int 13 call, int 13/ah = 48h. Although I notice that DL=0, which is not supposed to happen. Perhaps you can add a grub_printf in grub_chainloader_boot to show the value of boot drive:

static grub_err_t
grub_chainloader_boot (void)
{
grub_printf ("boot_drive=%d\n", boot_drive); grub_chainloader_real_boot (boot_drive, boot_part_addr);

/* Never reach here. */
return GRUB_ERR_NONE;
}

Signature · 1 line
Bean